//: Playground - noun: a place where people can play

import UIKit

// for var i = 0; i<10; i++ {
//     print(i)
// }

// for循环
for i in 0 ..< 10 {
    print(i)
}

// 如果不适用变量可以使用“_”代替，提高效率
for _ in 0...9 {
    print("-");
}

//for i in reverse(0...9) {
//    print(i)
//}

// 数组的for循环
let arr:[Int] = [1, 2, 4, 8]
for i in arr {
    print(i)
}

// 数组for循环的逆序
for i in arr.reversed() {
    print(i)
}







